var id = 0;

			function put(id1) {
				id1 = ++id;
				var putname = document.getElementById("putname");
				var putyear = document.getElementById("putyear");
				var html = "" +
					"<tr>" +
					"<td>" + id1 + "</td>" +
					"<td>" + putname.value + "</td>" +
					"<td>" + putyear.value + "</td>" +
					"<td>" + "<a href='javascript:del(" + id1 + ");'>delete</a>" + "   " +
					"<a href='javascript:upa(" + id1 + "," + putname.value + "," + putyear.value +
					");'>update</a>" + "</td>" +
					"</tr>";
				document.getElementById("body").innerHTML += html;
			}

			function del(id1) {
				var trarr = document.getElementsByTagName("tr");
				for (a in trarr) {
					var tr = trarr[a];
					var td = tr.getElementsByTagName("td");
					if (td[0].innerText == id1) {
						tr.remove();
						break;
					}
				}
			}

			function upa(id1, name, year) {
				var trarr = document.getElementsByTagName("tr");
				for (a in trarr) {
					var tr = trarr[a];
					var td = tr.getElementsByTagName("td");
					if (td[0].innerText == id1) {
						var html = "" +
							"<tr>" +
							"<td>" + id1 + "</td>" +
							"<td>" + "<input id='inputname' type='text' value=" + name + "  />" + "</td>" +
							"<td>" + "<input id='inputyear' type='text' value=" + year + " />" + "</td>" +
							"<td>" + "<a href='javascript:sav(" + id1 + ");'>save</a>" + "</td>" +
							"</tr>";
						tr.innerHTML = html;
						break;
					}
				}
			}

			function sav(id1) {
				var putname = document.getElementById("inputname");
				var putyear = document.getElementById("inputyear");
				var html = "" +
					"<tr>" +
					"<td>" + id1 + "</td>" +
					"<td>" + putname.value + "</td>" +
					"<td>" + putyear.value + "</td>" +
					"<td>" + "<a href='javascript:del(" + id1 + ");'>delete</a>" + "   " +
					"<a href='javascript:upa(" + id1 + "," + putname.value + "," + putyear.value +
					");'>update</a>" + "</td>" +
					"</tr>";
				var trarr = document.getElementsByTagName("tr");
				for (a in trarr) {
					var tr = trarr[a];
					var td = tr.getElementsByTagName("td");
					if (td[0].innerText == id1) {
						tr.innerHTML = html;
						break;
					}
				}
			}

			function search() {
				var searchname = document.getElementById("searchname");
				var trarr = document.getElementsByTagName("tr");
				for (a in trarr) {
					var tr = trarr[a];
					var td = tr.getElementsByTagName("td");
					// console.log(td[1].innerText);
					if (td[1].innerText == searchname.value) {
						tr.style.backgroundColor = "red";
					}
				}
			}